import axios from "axios";
import Alert from "./Alert.js";
const pathList={
	"path1":"http://127.0.0.1:8080",
	"path2":""
}
let http={
	post:function(url,data,success,error){
		Alert.loading();
		axios.post(
			pathList.path1+url,
			data
		).then(function(res){
			success(res);
		}).catch(function(e){
			error(e);
		}).finally(function(){
			Alert.loading(true);
		})
	},
	get:function(url,data,success){
		Alert.loading();
		axios.get(
			pathList.path1+url,
			data
		).then(function(res){
			success(res);
		}).catch(function(e){
			error(e);
		}).finally(function(){
			Alert.loading(true);
		})
	}
}
export default http;